package com.yanchangapp.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yanchangapp.R;
import com.yanchangapp.model.bean.POrderCntListBean;
import com.zxl.baselib.util.formatter.BigDecimalUtils;
import com.zxl.baselib.util.time.TimeUtil;
import com.zxl.baselib.util.ui.ResHelper;

import java.util.List;

/**
 * Created by apple on 2019-08-07.
 * description:
 */
public class POrderCntAdapter extends BaseQuickAdapter<POrderCntListBean, BaseViewHolder> {
    public POrderCntAdapter(int layoutResId, @Nullable List<POrderCntListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, POrderCntListBean psOrderListBean) {
        baseViewHolder.setText(R.id.tvCntNo,psOrderListBean.getInvoiceNo());
        baseViewHolder.setText(R.id.tvCntTime, TimeUtil.getDayTime(psOrderListBean.getContractTime()));
        baseViewHolder.setText(R.id.tvCntDept,psOrderListBean.getSupName());
        baseViewHolder.setText(R.id.tvCntMoney, ResHelper.getString(R.string.product_price, BigDecimalUtils.keep2Decimal(psOrderListBean.getTotalMoney())));
    }
}
